<!--#include file="../../core/common/Conn.asp" -->
<!--#include file="../../core/common/Limit.asp" -->
<%
	dim action
	action = request.QueryString("action")
	if action = "edit" then
		call edit
	else
		call default
	end if
	
	dim ID,NAME,PATH1,PATH2,PX
	
	'加载数据
	sub default
		ID = request.QueryString("id")
	
		dim rs,sql
		sql = "select * from [MODULE] where ID = " & ID
		set rs = db.query(sql)
		if not rs.eof then
			NAME = rs("NAME")
			PATH1 = rs("PATH1")
			PATH2 = rs("PATH2")
			PX = rs("PX")
		end if
		rs.close
		set rs = nothing
	end sub
	
	'编辑数据
	sub edit
		ID = request.Form("ID")
		NAME = request.Form("NAME")
		PATH1 = request.Form("PATH1")
		PATH2 = request.Form("PATH2")
		PX = request.Form("PX")

		dim rs,sql
		sql = "select * from [MODULE] where ID = " & ID
		set rs = db.query(sql)
		if not rs.eof then
			rs("NAME") = NAME
			rs("PATH1") = PATH1
			rs("PATH2") = PATH2
			rs("PX") = PX
			rs.update
		end if
		rs.close
		set rs = nothing
		
		response.Redirect("list.asp")
	end sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMSLite for ASP</title>
<link href="../resource/css/reset.css" rel="stylesheet" type="text/css" />
<link href="../resource/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../resource/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../resource/js/common.js"></script>
</head>

<body id="body">
	<div class="title_bar">
	编辑栏目类型
	</div>
	<form action="?action=edit" method="post">
	<p>
		<label>栏目类型</label>
		<input type="text" class="textbox" name="NAME" value="<%=NAME%>" />
	</p>
	<p>
		<label>栏目前台路径</label>
		<input type="text" class="textbox" name="PATH1" value="<%=PATH1%>" />
	</p>
	<p>
		<label>栏目后台路径</label>
		<input type="text" class="textbox" name="PATH2" value="<%=PATH2%>" />
	</p>
	<p>
		<label>排序</label>
		<input type="text" class="textbox" name="PX" value="<%=PX%>" />
	</p>
	<p>
		<input type="submit" class="button_1" value="修改" />
		<input type="button" class="button_1" value="取消" onclick="location.href='list.asp';" />
		<input type="hidden" name="ID" value="<%=ID%>" />
	</p>
	</form>
</body>
</html>
